<template>
    <div class="newsinfo-container">
        <h3 class="title">{{newsinfo.title}}</h3>
        <p class="subtitle">
            <span>发表时间：{{newsinfo.dataTime}}</span>
            <span>点击：{{newsinfo.count}}次</span>
        </p>
        <hr>
        <div class="content" v-html="newsinfo.De">

        </div>
        <!--评论子组件-->
        <comment-box></comment-box>
    </div>
</template>
<script>
import comment from '../subcomponents/comment.vue'

export default {
    data(){
        return{
            id:this.$route.params.id,
            app_key:'9701679D4CFB823670BA30DBEA0AE855',
            newsinfo:[]
        }
    },
    created(){
        this.getNewsList()
    },
    methods:{
        getNewsList(){
           
            this.$jsonp(
                'http://hd215.api.yesapi.cn/?&service=App.Table.FreeQuery&model_name=datail&logic=and&order=1&page=1&perpage=10&where=[["id","=","5"]]&app_key='+this.app_key,{}
                ).then((res)=>{
                   
                    this.newsinfo=res.data.list[0]
                })
        }
    },
    components:{
        "comment-box":comment
    }
}
</script>
<style lang="scss" >
.newsinfo-container{
    padding: 0 4px;
    .title{ 
        font-size: 16px;
        text-align: center;
        margin: 15px 0;
        color: red;
    }
    .subtitle{
        font-size: 13px;
        color:#226dff;
        display: flex;
        justify-content: space-between;
    }
    .content{
        img{
            width: 100%;
        }
    }
}
</style>
